# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=gosec
pkgver=2.19.0
pkgrel=2
pkgdesc="Go source code static analyzer, focusing on security"
url="https://github.com/securego/gosec"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/securego/gosec/archive/refs/tags/v$pkgver.tar.gz"
# downloads go deps into GOBIN and runs them
options="!check"

export GOBIN=/tmp
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make PREFIX="/usr" VERSION="$pkgver"
}

check() {
	make test
}

package() {
	install -Dm755 gosec -t "$pkgdir"/usr/bin
}

sha512sums="
96bd3e25761b07fdd4a0ee7d79bf8f8ed35ed7e8b1dcc6033741fd1e0bcdc44807b8e497b6c29551ca7baf94807bbfadbcea36632cdc1c0b7d25b0eed6068016  gosec-2.19.0.tar.gz
"
